#include "defines.hpp"

Projetil::Projetil()
{
    x = 0.0f;
    y = 0.0f;
    z = 0.0f;
    init = false;
}

Projetil::~Projetil()
{
    //dtor
}

Projetil::Projetil(float posx, float posy, float posz){
    x = posx;
    y = posy;
    z = posz;
    init = true;
}

void Projetil::Desenha(float posx, float posy, float posz){

    glColor3f(1.0f,0.75f,0.0f);
    glPushMatrix();


    //glLoadIdentity();
    if (!init) {
      x = posx;
      y = posy;
      z = posz;
      init = true;
    }
    glColor3f(0.0f,1.0f,0.0f);
    glBegin(GL_LINES);
    glVertex3f(x,y,z);
    glVertex3f(x,y,z+0.07f);
    glEnd();
    //glutSolidSphere(0.03f, 10, 10);
    /*glutSolidCone(0.1f,0.2f,10,10);
    glRotatef(GL_PI,-1.0f,0.0f,0.0f);*/
    glPopMatrix();
    glFrontFace(GL_CCW);
}

void Projetil::Desloca(float posx, float posy, float posz){
    //Insira checagem de colisao aqui.
    if (z<0.98f){
        Desenha(posx,posy,posz);
    }
}

float Projetil::GetX() {
  return x;
}

float Projetil::GetY() {
  return y;
}

float Projetil::GetZ() {
  return z;
}

void Projetil::SetX(float tx){
  x = tx;
}

void Projetil::SetY(float ty){
  y = ty;
}

void Projetil::SetZ(float tz){
  z = tz;
}
